<!DOCTYPE html>
<html xmlns:th="http://thymeleaf.org">
<head>
    <title></title>
    <link rel="stylesheet" th:href="@{/adminlte/bower_components/bootstrap/dist/css/bootstrap.min.css}">
    <!-- Font Awesome -->
    <link rel="stylesheet" th:href="@{/adminlte/bower_components/font-awesome/css/font-awesome.min.css}">
    <!-- Ionicons -->
    <link rel="stylesheet" th:href="@{/adminlte/bower_components/Ionicons/css/ionicons.min.css}">
    <!-- DataTables -->
    <link rel="stylesheet" th:href="@{/adminlte/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css}">
    <link rel="stylesheet" th:href="@{/adminlte/bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css}">
    <!-- Theme style -->
    <link rel="stylesheet" th:href="@{/adminlte/dist/css/AdminLTE.min.css}">
    <link rel="stylesheet" th:href="@{/adminlte/dist/css/skins/_all-skins.min.css}">
    <link rel="stylesheet" th:href="@{/adminlte/bower_components/fullcalendar/dist/fullcalendar.min.css}">
    <link rel="stylesheet" th:href="@{/adminlte/bower_components/fullcalendar/dist/fullcalendar.print.min.css}" media="print">
</head>
<body>
<div class="box box-info">
    <form id="form" th:action="@{/page/addnews}" method="post" th:object="${news}">
        <div class="box-body">
            <!--                                <div class="form-group">-->
            <!--                                    <label for="uId">uid</label>-->
            <!--                                    <input type="hidden" name="cId" th:field="*{cId}">-->
            <!--                                    <input type="text"  id="uId" name="uId" th:field="*{uId}" class="form-control" >-->

            <!--                                </div>-->
            <div class="form-group">
                <label for="newstitle">Title</label>
                <input type="hidden" name="newsid" th:field="*{newsid}">

                <input type="text"  id="newstitle" name="newstitle" th:field="*{newstitle}" class="form-control" >
            </div>

            <div class="form-group">
                <label for="newscontent">Content</label>
                <input type="text"  id="newscontent" name="newscontent" th:field="*{newscontent}" class="form-control" >

                <!--<input type="email"  id="email" name="email" th:field="*{address}" class="form-control" >-->
            </div>


<!--            <div class="form-group">-->
<!--                <label for="content">content</label>-->
<!--                <input type="text"  id="content" name="content" th:field="*{content}" class="form-control" >-->

<!--                &lt;!&ndash;<input type="email"  id="email" name="email" th:field="*{address}" class="form-control" >&ndash;&gt;-->
<!--            </div>-->

        </div>
        <!-- /.box-body -->
        <div class="box-footer">
            <button type="button" class="btn btn-default" id="btn_qx">取消</button>
            <button type="button" class="btn btn-info pull-right" id="btn_ok">确定</button>
        </div>
        <!-- /.box-footer -->
    </form>
</div>
<script th:src="@{/adminlte/bower_components/jquery/dist/jquery.min.js}"></script>
<!-- Bootstrap 3.3.7 -->
<script th:src="@{/adminlte/bower_components/bootstrap/dist/js/bootstrap.min.js}"></script>
<!-- DataTables -->
<script th:src="@{/adminlte/bower_components/datatables.net/js/jquery.dataTables.min.js}"></script>
<script th:src="@{/adminlte/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js}"></script>
<!-- SlimScroll -->
<script th:src="@{/adminlte/bower_components/jquery-slimscroll/jquery.slimscroll.min.js}"></script>
<!-- FastClick -->
<script th:src="@{/adminlte/bower_components/fastclick/lib/fastclick.js}"></script>
<script th:src="@{/adminlte/dist/js/adminltejs/adminlte.min.js}"></script>
<script th:src="@{/adminlte/dist/js/demo.js}"></script>
<script th:src="@{/adminlte/bower_components/jquery-ui/jquery-ui.min.js}"></script>
<script th:src="@{/adminlte/bower_components/moment/moment.js}"></script>
<script th:src="@{/adminlte/bower_components/fullcalendar/dist/fullcalendar.min.js}"></script>
<script th:src="@{/adminlte/bower_components/layer/layer.js}"></script>
<script th:src="@{/adminlte/bower_components/bootstrap-datepicker/js/bootstrap-datepicker.js}"></script>
<script th:src="@{/adminlte/bower_components/bootstrap-datepicker/js/locales/bootstrap-datepicker.zh-CN.js}"></script>


<!-- AdminLTE App -->
<script th:src="@{/adminlte/dist/js/adminlte.min.js}"></script>
<!-- AdminLTE for demo purposes -->
<script th:src="@{/adminlte/dist/js/demo.js}"></script>
<script>
    $(function () {
        $("#hireDate").datepicker({
            format:"yyyy-mm-dd",
            language:"zh-CN"

        });
        $("#btn_qx").click(function () {
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            parent.layer.close(index); //再执行关闭
        });

        $("#btn_ok").click(function () {
            $.ajax({
                type: "POST",
                url: "/page/addnews",
                data: $("#form").serialize(),
                success: function(){
                    layer.msg("修改成功");
                    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                    setTimeout(function (){
                        parent.layer.close(index)
                        parent.location.reload();
                    },1000);

                    //  parent.layer.close(index); //再执行关闭
                },

            });

        });
    });

</script>

</body>
</html>
